﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;

public partial class ms_page : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack == false)
        {
            if (!String.IsNullOrEmpty(Page.User.Identity.Name))
            {
                lbUser.Text = Page.User.Identity.Name;
            }
            hide();
        }
    }

    private void hide()
    {
        try
        {
            if (HttpContext.Current.Session["r"].ToString() == "1")
            {
                titlenv.Visible = true;
                nv.Visible = true;
                return;
            }
            if (HttpContext.Current.Session["r"].ToString() == "2")
            {
                titletest.Visible = true;
                test.Visible = true;
                titleUser.Visible = true;
                User.Visible = true;
                return;
            }
            if (HttpContext.Current.Session["r"].ToString() == "3")
            {
                titleReview.Visible = true;
                Review.Visible = true;
                return;
            }
            if (HttpContext.Current.Session["r"].ToString() == "4")
            {
                titleReview.Visible = true;
                Review.Visible = true;
                titletest.Visible = true;
                test.Visible = true;
                titlenv.Visible = true;
                nv.Visible = true;
                titleUser.Visible = true;
                User.Visible = true;
                return;
            }
        }
        catch (Exception)
        {
            Response.Redirect("Login.aspx");
        }
        
    }
}
